<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>考试试卷</title>
<script type="text/javascript" src="../static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="../static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../static/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../static/easyui/public-method.js"></script>
<script type="text/javascript" src="../static/zyc/js/Kno_wle.js?<%=Math.random()%>"></script>
<link rel="stylesheet" href="../static/easyui/themes/icon.css">
<link rel="stylesheet" href="../static/easyui/themes/metro-orange/easyui.css">
<link rel="stylesheet" href="../static/easyui/themes/metro-red/window.css">
<link rel="icon" href="../static/ttt/images/oac.ico"> 


</head>
<body>
 <style type="text/css">
     .shijuan_zong{
				width:1200px;
				background-color:white;
				margin:auto;
			}
			.sj_huanying{
			  width:1200px;
			  height:25px;
			  line-height:25px;
			  background-color:#2ABF9F;
			  color:white;
			  font-size:13px;
			  text-align:center;
			  
			}
			.sj_top,.sj_center,.sj_bottom{
				width:1100px;
				margin-left:30px;
			}
			.sj_xuzhi{
			   margin-left:30px;
			   width:1000px;
			}
			.sj_top{
				height:112px;
				margin-top:10px;
			}
			.sj_shijuan{
			    width:1100px;
				margin-top:2px;
				font-size:20px;
				font-weight:bold;
				font-family:'微软雅黑';
				text-align:center;
			}
			.sj_chujuanren,.sj_kaoshitime,.sj_shichang{
				width:1100px;
				margin-top:2px;
				font-size:15px;
				font-weight:bold;
				font-family:'微软雅黑';
				text-align:center;
				
			}
			.sj_shijuan{
				height:40px;
				line-height:40px;
				font-size:20px;
				font-family:'微软雅黑';	
			}
			.sj_chujuanren,.sj_kaoshitime,.sj_shichang{
				height:20px;
			}
			.sj_center{
				height:35px;
			}
			.sj_xingming,.sj_zhunkaozheng{
		      
				margin-top:5px;
				height:30px;
				line-height:30px;
				font-size:15px;
				font-weight:bold;
			}
			.sj_xingming{
			    width:16%;
				float:left;
				margin-left:370px;
			}
			
			.sj_zhunkaozheng{
			    width:18%;
				float:right;
				margin-right:340px;
			}
			.sj_xuzhi{
			   height:130px;
			}
			.sj_xuzhione{
			   height:30px;
			   line-height:30px;
			   color:red;
			   font-size:15px;
			   font-weight:bold;
			   font-family:'微软雅黑';
			}
			.sj_xuzhitwo{
			    height:100px;
			    width:1060px;

			}
			.sj_xuzhithree{
			   height:100px;
			   width:800px;
			   float:left;

			}
			.sj_xuzhifour{
			   height:40px;
			   line-height:40px;
			   text-indent:1em;
			   width:210px;
			   border:1px dashed #2ABF9F;
			   border-radius:5px;
			   font-size:16px;
			   font-weight:bold;
			   font-family:'微软雅黑';
			   position: fixed;
			   top: 150px;
			   right:100px;
			}
			.sj_xuzhi1,.sj_xuzhi2,.sj_xuzhi3,.sj_xuzhi4{
			   height:25px;
			   line-height:20px;
			   font-size:15px;
			   font-weight:bold;
			   font-family:'微软雅黑';
			}
			.sj_xunzheti,.sj_zongheti{
				width:1100px;
				margin-top:15px;
			}
			
			.sj_xunzhe,.sj_zonghe{
				width:140px;
				margin-left:15px;
				height:30px;
				line-height:25px;
				font-size:15px;
				font-weight:bold;
				border:2px solid #2ABF9F;
				font-family:'微软雅黑';	
				border-radius: 6px;
				text-align: center;
			}
			.sjxz_timu{
				width:1100px;
				font-size:16px;
				font-family:'微软雅黑';	
			}
			.sjxz_timu2{
				width:1000px;
				margin-top:10px;
				margin-left:25px;
				font-weight:bold;
				font-size:16px;
				font-family:'微软雅黑';
			}
			.sjxz_daan{
			   width:1000px;
			   margin-left:25px;
			   height:100px;
			   
			}
			.sjxz_daan,.sjzh_daan,.sjzh_timu2{
				margin-top:5px;
			}
			.sjxz_daan1,.sjxz_daan2,.sjxz_daan3,.sjxz_daan4{
				width:900px;
				height:25px;
				line-height:25px;
				font-size:15px;
				font-family:'微软雅黑';	
			}
			.sjzh_timu,.sjzh_timu2{
				width:1100px;
		    }
		    .sjzh_daan{
		      width:900px;
		      margin-left:25px;
		    }
		    .sjzh_da{
		         width:900px;
		         margin-top:5px;
		         border:1px solid #2ABF9F;
		         height:200px;
		         font-size:15px;
				 font-family:'微软雅黑';	
		       
		    }
			.sjzh_timu2{	
				width:1000px;
				margin-top:10px;
				margin-left:25px;
				font-weight:bold;
				font-size:16px;
				font-family:'微软雅黑';
				
     }
     .sj_tijiao{
        margin-top:30px;
        width:1000px;
        height:40px;
     }
     .sj_ti{
        margin-left:500px;
        line-height:25px;
        background-color:#2ABF9F;
	    font-size:16px;
	    font-family:'微软雅黑';
	    color:white;
	    width:80px;
	    height:30px;
	    border-radius: 15px;
	    border-color:none;
     }
     .none{
     	display: none;
     }
     .tijiaotankuang_one,.tijiaotankuang_two{
        width:300px;
	    height:50px;
	    margin-top:8px;
     }
     .sjtj_chenggong{
	   width:300px;
	   height:50px;
	   line-height:40px;
	   text-align:center;
	   font-size:16px;
	    font-family:'微软雅黑';
	}
	
	.sjtj_queding{
        line-height:30px;
        background-color:#2ABF9F;
	    font-size:15px;
	    font-family:'微软雅黑';
	    color:white;
	    width:60px;
	    height:30px;
	    margin-left:115px;
	    border-radius:5px;
	    border-color:none;
     }
 </style>
<script type="text/javascript">
$('#tt').tabs({
    border:false,
    onSelect:function(title){
		alert(title+' is selected');
    }
});

function ChangeHourMinutestr(str) {
	if (str !== "0" && str !== "" && str !== null) {
		return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :(Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
	}else{
		return "";
	}
}

//倒计时
$(function(){
	var newtime = $(".sj_kaoshishichang").text();
	var olrtime = new Date();
	setInterval(daotime, 1);
	function daotime() {
		var olrh = olrtime.getHours();
		var olrm = olrtime.getMinutes();
		var olrs = olrtime.getSeconds();
		var newtimes = ChangeHourMinutestr(newtime).split(":");
		olrh = olrh+parseInt(newtimes[0]);
		olrm = olrm+parseInt(newtimes[1]);
		
		var date= new Date();
		var dath = date.getHours();
		var datm = date.getMinutes();
		var dats = date.getSeconds();
		var times = date.getTime();
		if(olrs<dats){
			$(".sj_xuzhifour").text("倒计时:"+(olrh-dath)+"时"+(olrm-datm-1)+"分"+(60+olrs-dats)%60+"秒     "+(times)%1000);
		}else{
			$(".sj_xuzhifour").text("倒计时:"+(olrh-dath)+"时"+(olrm-datm)+"分"+(60+olrs-dats)%60+"秒     "+(times)%1000);
		}
		//如果倒计时完成，直接自行提交，返回登录页面
		if(olrm-datm==0&&olrh-dath==0&&olrs-dats==0){
			alert("考试时间到了，系统为你自动提交答案！")
			/* $("#sj_tijiaotankuang").window("open"); */
			daantijiao();
			login_zx();
			
		}
	}
	/* 提交 */
	 $(".sj_ti").click(function(){
		 if(confirm("你确定要提交试卷吗 ？")){
			 daantijiao();
			 login_zx();
			}else{
				
			}
		 
	 });
	
});

function daantijiao(){
	var s1 = "";
	$(".sjxz_daan").each(function(){
		var radio = $(this).find("input[type='radio']:checked");
		var cheackbox = $(this).find("input[type='checkbox']:checked");
		var s2 = "";
		for (var i = 0; i < radio.length; i++) {
				s2 += radio[i].value + '';
		}
		for (var i = 0; i < cheackbox.length; i++) {
				s2 += cheackbox[i].value + '';
		}
		if(cheackbox.length!=0 || radio.length!=0)
			s1 +=s2+"#";
		else
			s1 += "null#";
	})
	var d1=s1.substring(0,s1.length-1);
	
	var s3="";
	$(".sjzh_da").each(function(){
		if($(this).val()=="null" || $(this).val()==null || $(this).val()=="")
			s3+= "null#";
		else
			s3 += $(this).val()+"#";
	});
	var d2=s3.substring(0,s3.length-1);

	/* console.log(d1)
	console.log(d2) */
	var a=$(".zkz").val();
	var b=$(".out").val();
	$.ajax({
		url:"shijuandaan",
		type:"post",
		data:{"ZKZID":a,"OUTID":b,"DAXZT":d1,"DAZHT":d2},
		success:function(data){
			
		}
	})
	/* 
	  $(".sjtj_queding").click(function(){
		 $("#sj_tijiaotankuang").window("colse"); 
	 });
	  */
};


</script>
            <!--    <div id="sj_tijiaotankuang" class="easyui-window" title="新增" style="width:320px;height:165px"
		    		     data-options="closed:true,minimizable:false,maximizable:false,collapsible:false,modal:true">
		    		             <div class="tijiaotankuang_one">
		    		                   <div class="sjtj_chenggong">是否确认提交试卷？</div>
		    		                  
		    		             </div>
		    		             <div class="tijiaotankuang_two">
		    		                  <button id="dsx-beok" class="sjtj_queding">确定</button>
		    		             </div>
		      </div>  -->
		   <div class="shijuan_zong">
		                  <div class="sj_huanying">欢迎参加AWSLNB公司考试</div>
		    		      <div class="sj_top">
		    		              <div class="sj_shijuan">${ShiJuanXX[0]["OUTNAME"] }考试试卷</div>
		    		              <div class="sj_chujuanren">出卷人：${ShiJuanXX[0]["CJNAME"] }</div>
		    		              <div class="sj_kaoshitime">考试时间：${ShiJuanXX[0]["FEBMINTIME"] }</div>
		    		              <div class="sj_shichang">考试时长：<span class="sj_kaoshishichang">${ShiJuanXX[0]["FEBSC"] }</span></div>
		    		      </div>
		    		       <div class="sj_center">
		    		       		<c:if test="${empty ShiJuanXX[0]['KSNAME'] }">
		    		       			<div class="sj_xingming">姓名：${ShiJuanXX[0]["KSNAMES"] }</div>
		    		       		</c:if>
		    		       		<c:if test="${empty ShiJuanXX[0]['KSNAMES'] }">
		    		       			<div class="sj_xingming">姓名：${ShiJuanXX[0]["KSNAME"] }</div>
		    		       		</c:if>
		    		              
		    		              <div class="sj_zhunkaozheng">准考证号：${ShiJuanXX[0]["ZKZREM"] }</div>
	
		    		      </div>
		    		      <div class="sj_xuzhi">
		    		             <div class="sj_xuzhione">正式阅读前请认真阅读下列考试须知。</div>
		    		             <div class="sj_xuzhitwo">
		    		               <div class="sj_xuzhithree">
		    		                   <div class="sj_xuzhi1">1.必须使用本人的协同账号登录进入试题，答题过程中必须本人操作，否则按作弊处理。</div>
		    		                   <div class="sj_xuzhi2">2.打开本试题并阅读完考试须知后，才能进行正式答题。</div>
		    		                   <div class="sj_xuzhi3">3.答题完之后，点击提交按钮即可提交答案，便可退出网站。</div>
		    		                   <div class="sj_xuzhi4">4.答题时间不满15分钟不能交卷，未在规定的时间内完成答题的答题分数作废。</div>
		    		               </div>    
		    		                    <div class="sj_xuzhifour">倒计时:1时30分0秒</div>
		    		             </div>
		    		      </div>
		    		      <div class="sj_bottom">
		    		             <div class="sj_xunzheti">
		    		             		<div class="sj_xunzhe">选择题   [共 ${ShiJuanXX[0]['xzt'] }分]</div>
			    		                 <div class="sjxz_timu">
			    		                 	<%! int s=0; %>
		    		             			<c:forEach items="${ShiJuanXX[1] }" var="s">
		    		             			<c:if test="${s['TMTYPE']=='选择题' }">
			    		                      <div class="sjxz_timu2">[${s["TMFS"] }分]<%= s=s+1 %> . ${s["tm"] } （选  ${s["XZTDA"] } 项）</div>
			    		                      
			    		                      <div class="sjxz_daan">
			    		                      	<c:if test="${s['XZTDA']==1 }" var="ss">
				    		                         <div class="sjxz_daan1"><input type="radio" value="A" name="zhi<%= s %>"/>A.${s["DA1"] }</div>
				    		                         <div class="sjxz_daan2"><input type="radio" value="B" name="zhi<%= s %>"/>B.${s["DA2"] }</div>
				    		                         <div class="sjxz_daan3"><input type="radio" value="C" name="zhi<%= s %>"/>C.${s["DA3"] }</div>
				    		                         <div class="sjxz_daan4"><input type="radio" value="D" name="zhi<%= s %>"/>D.${s["DA4"] }</div>
				    		                    </c:if>
			    		                      	<c:if test="${not ss }">
				    		                         <div class="sjxz_daan1"><input type="checkbox" value="A" name="zhi<%= s %>"/>A.${s["DA1"] }</div>
				    		                         <div class="sjxz_daan2"><input type="checkbox" value="B" name="zhi<%= s %>"/>B.${s["DA2"] }</div>
				    		                         <div class="sjxz_daan3"><input type="checkbox" value="C" name="zhi<%= s %>"/>C.${s["DA3"] }</div>
				    		                         <div class="sjxz_daan4"><input type="checkbox" value="D" name="zhi<%= s %>"/>D.${s["DA4"] }</div>			    		                      		
			    		                      	</c:if>
			    		                      </div>
			    		                    </c:if>
		    		             			</c:forEach>
			    		                 </div> 
		    		                 
		    		             </div>
		    		              <div class="sj_zongheti">
		    		                 <div class="sj_zonghe">综合题  [共 ${ShiJuanXX[0]['zht'] }分]</div>
		    		                 <div class="sjzh_timu">
		    		                 <c:forEach items="${ShiJuanXX[1] }" var="t">
		    		             	 <c:if test="${t['TMTYPE']=='综合题' }">
		    		                      <div class="sjzh_timu2">[${t["TMFS"] }分]<%= s=s+1 %> . ${t["tm"] }</div>
		    		                      <div class="sjzh_daan"><textarea cols="50" rows="10" class="sjzh_da" id="sj_daan"></textarea></div>
		    		                 
		    		                 </c:if>
		    		                 </c:forEach>
		    		                </div>
		    		              </div>
	
		    		      </div>
		    		       <input type="hidden" value="${ShiJuanXX[0]['ZKZID'] }" class="zkz">
		    		       <input type="hidden" value="${ShiJuanXX[0]['OUTID'] }" class="out">
		    		      <div class="sj_tijiao"><button class="sj_ti" >提交</button></div>
		    		           
			</div>

			
</body>

</html>